home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / DMO / DMODemo / debug.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  1.9 KB  |  82 lines

  1. //------------------------------------------------------------------------------
  2. // File: Debug.h
  3. //
  4. // Desc: DirectShow sample code - debug header.
  5. //
  6. // Copyright (c) 1995-2001 Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9.  
  10. #ifndef __DEBUG_INCLUDED__
  11. #define __DEBUG_INCLUDED__
  12. #ifdef __cplusplus
  13. extern "C"
  14. {
  15. #endif
  16.  
  17. //
  18. //
  19. //
  20. //
  21. #ifdef DEBUG
  22.     #define DEBUG_SECTION       "Debug"     // section name for 
  23.     #define DEBUG_MODULE_NAME   "DSSHOW"    // key name and prefix for output
  24.     #define DEBUG_MAX_LINE_LEN  255         // max line length (bytes!)
  25. #endif
  26.  
  27.  
  28. //
  29. //  based code makes since only in win 16 (to try and keep stuff out of
  30. //  [fixed] data segments, etc)...
  31. //
  32. #ifndef BCODE
  33. #ifdef _WIN32
  34.     #define BCODE
  35. #else
  36.     #define BCODE           _based(_segname("_CODE"))
  37. #endif
  38. #endif
  39.  
  40.  
  41.  
  42.  
  43. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  44. //
  45. //
  46. //
  47. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  48.  
  49. #ifdef DEBUG
  50.     BOOL WINAPI DbgEnable(BOOL fEnable);
  51.     UINT WINAPI DbgGetLevel(void);
  52.     UINT WINAPI DbgSetLevel(UINT uLevel);
  53.     UINT WINAPI DbgInitialize(BOOL fEnable);
  54.     void WINAPI _Assert( char * szFile, int iLine );
  55.  
  56.     void FAR CDECL dprintf(UINT uDbgLevel, LPSTR szFmt, ...);
  57.  
  58.     #define D(x)        {x;}
  59.     #define DPF         dprintf
  60.     #define DPI(sz)     {static char BCODE ach[] = sz; OutputDebugStr(ach);}
  61.     #define ASSERT(x)   if( !(x) )  _Assert( __FILE__, __LINE__)
  62. #else
  63.     #define DbgEnable(x)        FALSE
  64.     #define DbgGetLevel()       0
  65.     #define DbgSetLevel(x)      0
  66.     #define DbgInitialize(x)    0
  67.  
  68.     #ifdef _MSC_VER
  69.     #pragma warning(disable:4002)
  70.     #endif
  71.  
  72.     #define D(x)
  73.     #define DPF()
  74.     #define DPI(sz)
  75.     #define ASSERT(x)
  76. #endif
  77.  
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif  // __DEBUG_INCLUDED__
  82.